package com.ddtech.business.task.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ddtech.business.task.entity.Task;
import com.ddtech.business.task.vo.req.MyTaskCourseVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 任务表 Mapper 接口
 * </p>
 *
 * @author bin_pu
 * @since 2023-02-06
 */
@Mapper
public interface TaskMapper extends BaseMapper<Task> {
    /**
     * 查询是否有任务关联
     * @param courseId
     * @param userId
     * @return
     */
    List<Task> queryByCourseIdAndUserId(@Param("courseId") String courseId, @Param("userId") String userId);

    /**
     * 进度查询
     * @param page
     * @param taskName
     * @return
     */
    IPage<Map<String, Object>> getScheduleList(IPage page, @Param("taskName")String taskName);

    /**
     * getMytask
     * @param page
     * @param userId
     * @param isFinish
     * @return
     */
    IPage<Task> getMyTask(IPage page, @Param("userId")String userId,@Param("isFinish")Integer isFinish);

    /**
     * 查询任务课程
     * @param userId
     * @param taskId
     * @return
     */
    List<MyTaskCourseVo> getMyTaskCourse(@Param("userId")String userId,@Param("taskId")String taskId);

}
